/**
 * Created by liekkas on 2018/6/27.
 */
let Base64 = require('js-base64').Base64;
import Cookies from 'js-cookie';
export default {
    //基础配置
    baseURL:             'http://127.0.0.1:8003',
    // baseURL:             'http://www.uutobe.com:8003',
    //请求头信息
    headers:{
            "Authorization":Base64.encode(Cookies.get('token')),
            "client":"WEB"
    },
    //权限部分
    //用户
    users:{
        base:             "/users",
        menu:            "/users/menu",
        roles:           "/users/roles",
        organizations:   "/users/organizations"
    },
    //资源
    resources:           {
        base:            "/resources",
        tree:            "/resources/tree",
        interface:      "/resources/interface",
        table:          "/resources/table"
    },
    //数据字典
    dictionarys:            {
        base :            "/dictionarys",
        tree:            "/dictionarys/tree",
        enum:            "/dictionarys/enum",
        form:            "/dictionarys/form",
        table:           "/dictionarys/table"
    },
    //角色
    roles:               {
        base:              '/roles',
        resources:         "/roles/{id}/resources"
    },
    //组织机构
    organizations:{
        base:               '/organizations',
        tree:              '/organizations/tree',
        master:            '/organizations/master',
    },
    //页面设计
    pageTemplates:{
        base:               "/pageTemplates"
    },
    //表单设计
    formTemplates:{
        base:               "/formtemplates",
        dictionary: {
            base :          "/formtemplates/dictionary", //获取表单设计的数据类型
            form :          "/formtemplates/dictionary/form", //获取form类型的数据词典
            interface:      "/formtemplates/dictionary/interface", //获取interface类型的数据词典
        },
        translate:          "/formtemplates/translate",  //翻译
        record:{
            base:           "/formtemplates/{templateId}/record",  //表单记录
        },
        structure:          "/formtemplates/{templateId}/structure" //同步表单和数据库表结构
    },
    //表结构设计
    tableTemplates:{
        base:               "/tabletemplates",
        column:             "/tabletemplates/{templateId}/column",  //字段
    },
    //附件上传
    upload:{
        base:               "/upload",
        custom:             "/upload/{id}/custom",  //自定义文件别名
       // files:              "http://www.uutobe.com:8003/upload/files", //文件上传路径
        files:              "http://127.0.0.1:8003/upload/files", //文件上传路径
    },
    //授权
    tokens:{
        web: "/tokens/web"
    },

    //流程设计器
    activity:{
        base:               "/activity",
        models:{
            base:           "/activity/models",
            deploy:         "/activity/models/{id}/deploy",
        },
        processDefines:{   //流程实例
            base:          "/activity/processDefines",
            view:          "/activity/processDefines/{deploymentId}/{diagramResourceName}",
        },
        view:              "/modeler.html?modelId={id}",
        templates:        "/activity/templates"
    }

};